package com.aztec.ims.service.dao;

import java.util.List;

import com.aztec.ims.domain.CustomInfoMetaData;
import com.aztec.ims.service.response.GenericResponse;

public class TestCustomInfoMetadataDao {
	public static void main(String[] args) {

		save();
		get();
	}

	private static void save() {
		CustomInfoMetadataDao dao = new CustomInfoMetadataDao();
		CustomInfoMetaData request = new CustomInfoMetaData();
		request.setFieldName("age");
		request.setFieldType("v");
		GenericResponse response = dao.createCustomMetaInfo(request);
		System.out.println("*****Carrier id generated:" + response.getId()
				+ "******");
	}

	private static void get() {
		CustomInfoMetadataDao dao = new CustomInfoMetadataDao();
		List list = dao.getCustomMetaInfo();
		for(int i=0;i<list.size();i++){
			CustomInfoMetaData info = (CustomInfoMetaData)list.get(i);
			System.out.println("***"+i+":"+info.getFieldId()+" ** :"+info.getFieldName()+" ** :"+info.getFieldType());
		}
	}

}
